/* SPDX-License-Identifier: GPL-2.0-only */
/*
 */

#ifndef _SERIAL_DRIVER_H
#define _SERIAL_DRIVER_H

#include <stdint.h>
#include <gio/gio.h>
#include <glib.h>

int serial_open(const char *node, int baud, uint8_t data_bit, char parity,
    uint8_t stop_bit);
void *virtual_serial_open();
char *virtual_serial_get_node(void *serial);
void *serial_to_udp(void *serial, void *inout);
void *serial_to_udp_handle(void *serial, void *net, void *addr,
    void *handle, void *user_data);
char *serial_driver__get_real_node(const char *name);
gboolean serial_read_to_tcp(GIOChannel *channel,
    GIOCondition condition, gpointer user_data);
uint8_t *serial_driver__str_to_hex(const char *content,
    size_t *size_p);
void serial_driver__print_hex2(const char *pre, const char *next,
    const uint8_t *buffer, size_t size);
#endif // _SERIAL_DRIVER_H
